﻿using System;
using Core.Domain.Bases;
using Core.Domain.Entities;
using Core.Domain.Interfaces;
using Core.IocHelpers;

namespace DataMain.Repositories
{
  [AutoRegister]
  public class CommunityRepository : EntityRepository<Community>, ICommunityRepository
  {
    private readonly ICommunityFinder _communityFinder;

    public CommunityRepository(IPersistanceRepository repository, ICommunityFinder finder)
      : base(repository)
    {
      _communityFinder = finder;
      _communityFinder.DataSource = Query();
    }

    #region ICommunityRepository Members

    public ICommunityFinder Find
    {
      get
      {
        return _communityFinder;
      }
    }

    #endregion
  }
}